<script setup lang="ts">
import { RouterView } from 'vue-router'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import { useUserStore } from '@/stores/user'

// 初始化用户状态
const userStore = useUserStore()
</script>

<template>
  <div>
    <el-config-provider :locale="zhCn">
      <RouterView v-slot="{ Component }">
        <template v-if="Component">
          <Suspense>
              <component :is="Component" />
              <!-- 加载中状态 -->
              <template #fallback> 正在加载... </template>
          </Suspense>
        </template>
      </RouterView>
    </el-config-provider>
  </div>
</template>

<style scoped>
</style>
